package com.example.demo.service.serviceimpl;

import com.example.demo.dao.CartDao;
import com.example.demo.entity.CartEntity;
import com.example.demo.service.CartService;
import com.example.demo.vo.CartVo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CartServiceImpl implements CartService {
    @Resource
    CartDao cartDao;
    @Override
    public List<CartEntity> getUserCart(int user_id) {
        return cartDao.getCart(user_id);
    }

    @Override
    public int addCart(CartVo cartVo) {
        return cartDao.addCart(cartVo);
    }

    @Override
    public int updateCart(CartVo cartVo) {
        return cartDao.upCart(cartVo);
    }

    @Override
    public int deleteCart(int id) {
        return cartDao.delCart(id);
    }

    @Override
    public int delCartUserId(int user_id) {
        return cartDao.delCartUserId(user_id);
    }
}
